/*
 * Created on 2005-1-6
 *
 */
package com.taobao.common.dao.persistence;

import java.util.List;

import com.taobao.common.dao.persistence.exception.DBRouterException;

/**
 * @author xingdian �����ݿ��·�ɹ�����
 * @version $Id: DBRouteManager.java,v 1.1 2005/05/13 08:11:21 xingdian Exp $
 */
public class DBRouteManager {
  private DBRouteConfig dbRouteConfig;

  /**
   * @return Returns the dbRouteConfig.
   */
  public DBRouteConfig getDbRouteConfig() {
    return dbRouteConfig;
  }

  /**
   * @param dbRouteConfig
   *          The dbRouteConfig to set.
   */
  public void setDbRouteConfig(DBRouteConfig dbRouteConfig) {
    this.dbRouteConfig = dbRouteConfig;
  }

  public List getSqlMapTemplates(DBRoute dbRoute, String sqlId) throws DBRouterException {
    if (null == dbRoute && null == sqlId) {
      throw new DBRouterException("�޷�ȷ��·�ɣ����������");
    }

    return getDbRouteConfig().routingDB(dbRoute, sqlId);
  }
}
